/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mvp.levelup.swing;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D;
import javax.swing.JPanel;

/**
 *
 * @author WORKSPOT2
 */
public class PaintPanel extends JPanel
{

    @Override
    public void paintComponent(Graphics g)
    {
        super.paintComponent(g);
        Graphics2D g2d = (Graphics2D) g;
        Rectangle2D r = new Rectangle2D.Double(10, 10, 30, 40);
        g2d.setColor(Color.red);
        g2d.setBackground(Color.GRAY);
        g2d.draw(r);
        Ellipse2D el = new Ellipse2D.Double(15, 15, 20, 20);
        g2d.setColor(Color.CYAN);
        g2d.draw(el);
        g2d.setColor(Color.PINK);
        Font f = new Font(Font.SANS_SERIF, Font.BOLD, 14);
        g2d.setFont(f);
        g2d.drawString("Hello!", 50, 50);
    }
}
